/*
 * $Id: utf8.h,v 1.2 2005-04-24 07:48:16 bacon Exp $
 */

#ifndef _XP_BAS_UTF8_H_
#define _XP_BAS_UTF8_H_

#include <xp/types.h>
#include <xp/macros.h>

#ifdef __cplusplus
extern "C" {
#endif

//please refer to www.unicode.org/public/programs/cvtutf/convertutf.c
		
xp_size_t xp_unicode_utf8_len (xp_wchar_t ucs);
xp_size_t xp_unicode_to_utf8 (
	xp_wchar_t ucs, xp_mchar_t* utf8, xp_size_t size);
xp_size_t xp_utf8_to_unicode (
	const xp_mchar_t* utf8, xp_size_t size, xp_wchar_t* ucs);
xp_size_t xp_utf8_sequence_len (xp_mchar_t first);

#ifdef __cplusplus
}
#endif

#endif
